package tech.aistar.Conteoller;


import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import tech.aistar.model.entity.Customer;
import tech.aistar.service.IJobService;

@Controller
@RequestMapping("index")
public class IndexController {
    @Autowired
    private RedisTemplate redisTemplate;

    @Autowired
    private IJobService iJobService;

    @GetMapping("loginto")
    public String loginTo(HttpServletRequest request){
        if(redisTemplate.hasKey("customer")){
            Customer customer= (Customer) redisTemplate.opsForValue().get("customer");
            request.setAttribute("customer",customer);
        }
//        request.setAttribute("jobs6",iJobService.findAllJob6(1));
        return "index/index";
    }


}
